package com.hzlx.entity;



import jakarta.persistence.*;
import lombok.*;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.util.Date;

/**
 * 切割设备状态实体类
 * 对应数据库表：cutting_machine_status
 */
@Entity
@Table(name = "cutting_machine_status")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class CuttingMachineStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @jakarta.persistence.Id
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    /**
     * PLC 节点标识
     */
    @Column(name = "node", nullable = false, length = 64)
    private String node;

    /**
     * 设备分组
     */
    @Column(name = "group_name", nullable = false, length = 64)
    private String groupName;

    /**
     * 数据接收时间戳（毫秒）
     */
    @Column(name = "timestamp", nullable = false)
    private Long timestamp;

    /**
     * 切割计数
     */
    @Column(name = "cut_count", nullable = false)
    private Integer cutCount;

    /**
     * 切割速度
     */
    @Column(name = "cut_speed", nullable = false, precision = 10)
    private Double cutSpeed;

    /**
     * 刀片寿命（百分比或剩余次数）
     */
    @Column(name = "cut_life", nullable = false)
    private Integer cutLife;

    /**
     * 电机过载状态（0: 正常, 1: 过载）
     */
    @Column(name = "engine_overload", nullable = false)
    private Integer engineOverload;
    /**
     * 记录创建时间
     */
    @Column(name = "created_at", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdAt;
}